<?php
require('path.inc.php');

$user = new User($query);
if($page->action == "unique"){
	$username = htmlspecialchars($_GET['username'],ENT_COMPAT,'utf-8');
	if($user->checkUserUnique($username)){
		echo 1;
	}else{
		echo 0;
	}
}
if($page->action == "ckpass"){
	$username = htmlspecialchars($_GET['username'],ENT_COMPAT,'utf-8');
	$password = md5($_GET['password']);
	if($user->checkUserPass($username,$password)){
		echo 1;
	}else{
		echo 0;
	}
}
if($page->action == "clang"){
	$lang = $_GET['lang'];
	$uid = intval($_GET['uid']);
	if($user->clang($lang,$uid)){
		echo 1;
	}else{
		echo 0;
	}
}

if($page->action == "ckvaild"){
	$vaild = htmlspecialchars($_GET['vaild'],ENT_COMPAT,'utf-8');
	if(md5(strtolower($vaild))==$_COOKIE['validString']){
		echo 1;
	}else{
		echo 0;
	}
}





	
	
?>